1. Field of the Invention
The present invention relates to detection of edges of an image, and more particularly, to a method and apparatus for detecting edges of an image obtained by mixing graphic and natural images.
2. Description of the Related Art
In contemporary multimedia personal computers, increasingly complicated images containing a mixture of graphics, text, and natural images are commonly processed. Often times such images are increased or decreased in size on a computer monitor, for example by a user. Such a process is referred to in the art as xe2x80x9czoomingxe2x80x9d the image. When interpolation is performed to digitally zoom the size of the image, edge information of the image is weakened. Accordingly, edge resolution should be maintained for regions where the edge information is important, such as in a graphic or text region of the image. Additionally, the edge information is required for segmentation of the graphic or text region from the natural image region and appropriate processing thereof.
In a conventional edge detecting process, the focus of the process is commonly on the detection of the edge of the natural image. Consequently, the edge of the graphic or text region accompanying the natural image cannot be effectively and stably detected.
Summary of the Invention
It is an object of the present invention to provide a method for detecting edges by which the detection of the edges of a natural image from an image obtained by mixing the graphic or text and the natural image, is suppressed , to thereby stably detect the edges of the graphic or the text.
It is another objective of the present invention to provide an apparatus for detecting edges by which the detection of the edges of a natural image from an image obtained by mixing the graphic or text and the natural image, is suppressed, to thereby stably detect edges of the graphic or the text.
Accordingly, the method for detecting edges for achieving the first objective is directed to a method for detecting edges in an image formed of pixels arranged in an array having first and second dimensions, each pixel having a data value, comprising: (a) obtaining value differences between a first pixel of the image and eight pixels adjacent the first pixel; (b) determining the first pixel as an edge pixel when all of the value differences between the first pixel and the eight pixels adjacent the first pixel are greater than a predetermined maximum threshold value or less than a predetermined minimum threshold value; (c) obtaining value differences between a second pixel of the image and eight pixels adjacent the second pixel, the second pixel being adjacent the first pixel in the first dimension (for example to the left of the first pixel); (d) determining the second pixel as an edge pixel when all of the value differences between the second pixel and the eight pixels adjacent the second pixel are greater than the maximum threshold value or less than the minimum threshold value; (e) obtaining value differences between a third pixel of the image and eight pixels adjacent the third pixel, the third pixel being adjacent the first pixel in the second dimension (for example above the first pixel); (f) determining the third pixel as an edge pixel when all of the value differences between the third pixel and the eight pixels adjacent the third pixel are greater than the maximum threshold value or less than the minimum threshold value; (g) determining that a first-dimension edge of the first pixel exists, when at least one of the first pixel and the second pixel is an edge pixel and when the value difference between the first pixel and the second pixel is greater than the maximum threshold value; and (h) determining that a second-dimension edge of the first pixel exists, when at least one of the first pixel and the third pixel is an edge pixel and when the value difference between the first pixel and the third pixel is greater than the maximum threshold value.
Preferably, the step (g) comprises the substeps of: determining that a first-dimension first temporary edge of the first pixel exists, when the first pixel is an edge pixel and when the value difference between the first pixel and the second pixel is greater than the maximum threshold value; determining that a first-dimension second temporary edge of the second pixel exists, when the second pixel is an edge pixel and when the value difference between the first pixel and the second pixel is greater than the maximum threshold value; and determining that the first-dimension edge of the first pixel exists, when at least one of the first-dimension first temporary edge of the first pixel and the first-dimension second temporary edge of the second pixel exists.
Preferably, the step (h) comprises the substeps of: determining that the second dimension first temporary edge of the first pixel exists, when the first pixel is an edge pixel and when the value difference between the first pixel and the third pixel is greater than the maximum threshold value; determining that the second-dimension second temporary edge of the third pixel exists, when the third pixel is an edge pixel and when the value difference between the first pixel and the third pixel is greater than the maximum threshold value; and determining that the second dimension edge of the first pixel exists, when at least one of the second-dimension first temporary edge of the first pixel and the second-dimension second temporary edge of the third pixel exists.
The apparatus for detecting edges according to the second objective is directed to an apparatus for detecting edges in images formed of pixels arranged in an array having first and second dimensions, each pixel having a data value, comprising: a pixel difference calculator for obtaining value differences between a sequential set of first pixels of the images and eight pixels adjacent each respective first pixel; an edge pixel determiner for determining the first pixels as edge pixels when the value differences calculated by the pixel difference calculator are greater than a maximum threshold value or less than a minimum threshold value; and an edge determiner for determining that an edge exists between adjacent pixels, when at least one of the adjacent pixels is determined as an edge pixel by the edge pixel determiner and when the value difference between the adjacent pixels is greater than the maximum threshold value.
Preferably, the edge determiner comprises: a temporary edge determiner for determining that a first-dimension first temporary edge of the first pixel exists, when the first pixel is an edge pixel and when the value difference between the first pixel and a second pixel adjacent the first pixel along a first dimension is greater than the maximum threshold value, and determining that a first-dimension second temporary edge of the second pixel exists, when the second pixel is an edge pixel and when the value difference between the adjacent pixels is greater than the maximum threshold value; and a final edge determiner for determining that an edge exists between the first and second pixels, when at least one of the first-dimension first temporary edge and the first-dimension second temporary edge exists.
The edge determiner may further comprise: a temporary edge determiner for determining that a second-dimension first temporary edge of the first pixel exists, when the first pixel is an edge pixel and when the value difference between the first pixel and a third pixel adjacent the first pixel along a second dimension is greater than the maximum threshold value, and determining that a second-dimension second temporary edge of the third pixel exists, when the third pixel is an edge pixel and when the value difference between the adjacent pixels is greater than the maximum threshold value; and a final edge determiner for determining that an edge exists between the first and third pixels, when at least one of the second-dimension first temporary edge and the second-dimension second temporary edge exists.